package com.ruoyi.hotel.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hotel.mapper.HlRegistryMapper;
import com.ruoyi.hotel.domain.HlRegistry;
import com.ruoyi.hotel.service.IHlRegistryService;

/**
 * 入住登记Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-10
 */
@Service
public class HlRegistryServiceImpl implements IHlRegistryService 
{
    @Autowired
    private HlRegistryMapper hlRegistryMapper;

    /**
     * 查询入住登记
     * 
     * @param id 入住登记主键
     * @return 入住登记
     */
    @Override
    public HlRegistry selectHlRegistryById(Long id)
    {
        return hlRegistryMapper.selectHlRegistryById(id);
    }

    /**
     * 查询入住登记列表
     * 
     * @param hlRegistry 入住登记
     * @return 入住登记
     */
    @Override
    public List<HlRegistry> selectHlRegistryList(HlRegistry hlRegistry)
    {
        return hlRegistryMapper.selectHlRegistryList(hlRegistry);
    }

    /**
     * 新增入住登记
     * 
     * @param hlRegistry 入住登记
     * @return 结果
     */
    @Override
    public int insertHlRegistry(HlRegistry hlRegistry)
    {
        hlRegistry.setCreateTime(DateUtils.getNowDate());
        return hlRegistryMapper.insertHlRegistry(hlRegistry);
    }

    /**
     * 修改入住登记
     * 
     * @param hlRegistry 入住登记
     * @return 结果
     */
    @Override
    public int updateHlRegistry(HlRegistry hlRegistry)
    {
        hlRegistry.setUpdateTime(DateUtils.getNowDate());
        return hlRegistryMapper.updateHlRegistry(hlRegistry);
    }

    /**
     * 批量删除入住登记
     * 
     * @param ids 需要删除的入住登记主键
     * @return 结果
     */
    @Override
    public int deleteHlRegistryByIds(Long[] ids)
    {
        return hlRegistryMapper.deleteHlRegistryByIds(ids);
    }

    /**
     * 删除入住登记信息
     * 
     * @param id 入住登记主键
     * @return 结果
     */
    @Override
    public int deleteHlRegistryById(Long id)
    {
        return hlRegistryMapper.deleteHlRegistryById(id);
    }
}
